$mainTop: 46px;
$leftSidebar: 160px;
$borderColor: rgb(234, 234, 234);
$baseColor: rgb(9, 188, 189);
$basePaddingLeft: 20px;

// 18 61 64

* {
    box-sizing: border-box;
}

*:before,
*:after {
    box-sizing: border-box;
}

html {
    font-size: 10px;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

ul {
    padding: 0;
    margin: 0;
    list-style: none;

    &.inline {
        font-size: 0;

        li {
            display: inline-block;
            font-size: 14px;
        }
    }
}

ol {
    padding: 0;
    margin: 0;
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
}

.pl0px {
    padding-left: 0 !important;
}

.mt5px {
    margin-top: 5px;
}

.mt10px {
    margin-top: 10px;
}

.ml10px {
    margin-left: 10px;
}

.ml20px {
    margin-left: 20px;
}

.small {
    font-size: 0.8em;
}

.colon {
    color: #999;
    

    &::after {
        content: '\FF1A';
    }
}

em {
    font-style: normal;
}

d-note {
    position: fixed;
    top: 46px;
    left: 0; right: 0;
    min-height: 46px;
    z-index: 887;

    background: #0000FF;

    &.hide {
        display: none;
    }

    &.show {
        display: block;
    }

    &.success {
        background-color: rgba(18, 61, 64, .8);
        text-align: center;
        color: #fff;
        line-height: 46px;
    }

    &.error {
        background-color: rgba(255, 0, 0, .6);
        text-align: center;
        color: #fff;
        line-height: 28px;

        .content {
            padding: $basePaddingLeft;
            padding-left: $leftSidebar;
            text-align: left;

            h5 {
                font-weight: bold;
                font-size: 16px;
            }

            ol {
                margin: 0;
                padding: 0;
                list-style: none;
            }


        }
    }

    &.alert {
        background-color: rgba(0, 0, 255, .2);
        text-align: center;
        color: #0066ff;
        line-height: 46px;
    }
}

.btn {
    display: inline-block;
    padding: 5px 10px;
    font-size: 14px;
    border: 1px solid $borderColor;

    &.full {
        width: 100%;
    }

    &.save {
        padding-left: 20px;
        padding-right: 20px;
    }

    &.blue {
        background: $baseColor;
        color: #fff;
        border: 1px solid rgba(9, 188, 189, .8);

        &:hover {
            background: rgba(9, 188, 189, .8);
        }
    }

    &.blue_outer {
        background: #fff;
        color: $baseColor;
        border: 1px solid $baseColor;

        &:hover {
            color: #666;
            background: #f5f5f5;
        }
    }

    &.white {
        background: #fff;
        color: #666;
        border: 1px solid #d2d2d2;

        &:hover {
            color: #666;
            background: #f5f5f5;
        }
    }

    &:hover {
        color: #fff;
        background: rgba(9, 188, 189, .6);
        cursor: pointer;
    }
}

input[type='text'],
input[type='password'],
select {
    padding: 0 0 0 5px;
    margin: 0;
    height: 32px;
    width: 200px;

    border: 1px solid $borderColor;
    outline: none;

    line-height: 32px;
    color: #666;

    &.full {
        width: 100%;
    }

    &.auto {
        width: auto;
    }

    &.large {
        width: 280px;
    }

    &.small {
        width: 150px;
    }

    &.ng-invalid.ng-touched {
        border: 1px solid #FF0000;
    }

}

.form {

    &.submitted {
        .ng-invalid {
            border: 1px solid #FF0000;
        }
    }

    > .item {
        min-height: 52px;
        label {
            display: inline-block;
            width: 120px;

            &::after {
                content: ': ';
            }

            &::before {
                content: '*';
                color: #fff;
            }

            &.required {
                &::before {
                    content: '*';
                    color: #f00;
                }
            }
        }
    }
}

body {
    line-height: 1.5;
}

#wrapper {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;

    padding: 0;
    margin: 0;

    min-width: 1240px;
    overflow-y: auto;

    background: #f6f6f6;

    color: #666;
    font-size: 14px;

    a {
        text-decoration: none;
        color: #666;
    }

    fe {
        position: relative;
        display: block;
        width: 100%;
        height: 100%;

        // login page style
        &.login {
            padding-top: 200px;

            .main {
                display: block;
                margin: 0 auto;
                padding: 30px 30px 50px;
                width: 60%;
                text-align: center;

                .logo {
                    margin-bottom: 25px;
                    height: 42px;
                    background: url("/assets/images/logo.png") no-repeat center center;
                    background-size: contain;
                }

                .btn {
                    margin-top: 20px;
                    padding-left: 100px;
                    padding-right: 100px;
                    height: 42px;
                    background: rgb(33, 41, 85);
                    border-radius: 5px;
                    font-size: 16px;
                    color: #fff;
                }

                .footer {
                    margin-top: 30px;
                    padding-top: 30px;
                    border-top: 1px solid $borderColor;
                    line-height: 2;
                }

                .colon {
                    color: #666;
                }

            }
        }



    }

    > .content {
        width: 100%;
        height: 100%;

        > layout {
            display: block;
            width: 100%;
            height: 100%;

            header {
                position: fixed;
                top: 0;
                left: 0;
                right: 0;
                height: $mainTop;
                background: rgb(56, 66, 114);
                z-index: 888;

                .logo,
                .nav,
                .bar {
                    position: absolute;
                    top: 0;
                    bottom: 0;

                    > li {
                        line-height: $mainTop;
                        color: #fff;

                        > a {
                            display: block;
                            width: 100%;
                            height: 100%;
                            color: #ddd;
                        }
                    }

                }

                .logo {
                    left: 0;
                    width: $leftSidebar;
                    line-height: $mainTop;
                    text-align: center;
                    font-size: 0;
                    background: rgb(33, 41, 85) url("/assets/images/logo_white.png") no-repeat $basePaddingLeft center;
                    background-size: 50%;
                }

                .nav {
                    left: $leftSidebar;
                    > li {
                        display: inline-block;

                        > a {
                            padding: 0 30px;
                        }

                        &.active,
                        &:hover {
                            background: rgba(255, 255, 255, .1);
                            color: $baseColor;
                            cursor: pointer;
                        }

                    }
                }

                .bar {
                    right: 0;
                    bottom: 0;
                    padding-right: 10px;
                    background: rgb(33, 41, 85);



                    > li {
                        padding: 0 20px;

                        &.m-setting {
                            background: rgb(56, 66, 114);
                        }

                        + li {
                            border-left: 1px solid rgba(255, 255, 255, .1);
                        }

                        &.active,
                        &:hover {
                            background: rgba(255, 255, 255, .1);
                            cursor: pointer;
                        }
                    }

                }
            }

            main {
                position: absolute;
                top: $mainTop;
                right: 0;
                bottom: 0;
                left: 0;
            }

            page {
                position: relative;
                display: block;
                width: 100%;
                height: 100%;

                &.dlg {
                    position: fixed;
                    top: 0;
                    right: 0;
                    bottom: 0;
                    left: 0;
                    padding-top: 200px;
                    background: rgba(0, 0, 0, .3);
                    z-index: 10000;

                    &.small > .content,
                    .content.small {
                        width: 400px;
                    }

                    .content {
                        margin: 0 auto;
                        width: 800px;
                        background: #fff;

                        .main {
                            padding: 20px;
                        }
                    }
                }

                .title-bar {
                    position: relative;
                    padding-left: $basePaddingLeft;
                    height: $mainTop;
                    background: #fff;
                    border-bottom: 1px solid $borderColor;

                    h5 {
                        display: inline-block;
                        font-size: 17px;
                        font-weight: 200;
                        line-height: 46px;

                        + .actions {
                            border-left: 1px solid $borderColor;
                        }
                    }

                    .actions {
                        position: absolute;
                        right: $basePaddingLeft;
                        top: 0;
                        bottom: 0;
                        padding-left: $basePaddingLeft;

                        &::before {
                            content: '';
                            display: inline-block;
                            width: 0;
                            height: 100%;
                            font-size: 0;
                            vertical-align: middle;
                        }
                    }
                }

                > .main {
                    margin: $basePaddingLeft;
                    padding: $basePaddingLeft;
                    min-height: 100px;
                    background: #fff;
                    border: 1px solid $borderColor;
                    box-shadow: 0 2px 5px 2px rgba(0, 0, 0, 0.1);
                }

                > .main-sidebar {
                    position: relative;
                    height: 100%;

                    > .sidebar {
                        padding-top: $basePaddingLeft;
                        width: $leftSidebar;
                        height: 100%;

                        background: #fff;
                        border-right: 1px solid $borderColor;

                        ol > li {
                            position: relative;
                            padding-left: $basePaddingLeft;
                            height: 52px;
                            line-height: 52px;
                            color: #999;

                            &.active,
                            &:hover {
                                background: #f0fbfc;
                                cursor: pointer;

                                > a {
                                    color: #14bbbc;

                                }

                                &::after {
                                    content: '';
                                    position: absolute;
                                    top: 0;
                                    bottom: 0;
                                    left: 100%;
                                    border-right: 2px solid $baseColor;
                                    z-index: 1000;
                                }
                            }

                            > a {
                                display: block;
                                width: 100%;
                                height: 100%;
                            }

                            + li {
                                margin-top: 1px;
                            }
                        }
                    }

                    > .main {
                        position: absolute;
                        left: $leftSidebar;
                        right: 0;
                        top: 0;
                        height: 100%;
                        padding: $basePaddingLeft;
                        overflow: hidden;
                        overflow-y: auto;

                        background: #fff;

                        .title-bar {
                            padding-left: 0;
                            .actions {
                                right: 0;
                            }
                        }

                        .dlg {
                            .title-bar {
                                padding-left: $basePaddingLeft;
                            }
                        }

                    }

                }
            }

            .table {
                width: 100%;
                max-width: 100%;
                border: 0;
                border-spacing: 0;
                border-collapse: collapse;

                th, td {
                    text-align: left;
                    padding: 5px 5px 5px 10px;
                    height: 36px;
                }

                th {
                    font-weight: 200;
                    font-size: 15px;
                    background: #f3f3f3;
                    color: #666;
                }

                td {
                    border-top: 1px solid $borderColor;
                    font-size: 14px;

                    &:first-child {
                        a {
                            color: $baseColor;

                            &:hover {
                                text-decoration: underline;
                            }
                        }
                    }
                }

                &.hover {
                    > tbody {
                        > tr:hover {
                            background: #f8f8f8;
                        }
                    }
                }
            }
        }
    }

}